const mysql = require("mysql");
const connection = mysql.createConnection({
  host: "127.0.0.1",
  user: "root",
  password: "123nishengri",
  port: 3306,
  database: "myproject",
});
connection.connect((err) => {
  if (err) return console.log("连接数据库失败", err);
  console.log("连接数据库成功----1");
});
connection.on('error', (err) => {
  console.error('Database connection error:', err);
});
module.exports = connection;
